package com.hopes.bizz.risk.control.vo;

import com.hopes.bizz.risk.common.constant.enums.RiskModDictEnum;
import com.hopes.bizz.risk.common.constant.enums.RiskSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author daijie
 * @version 1.0
 * @date 2023/7/18 10:16
 * @Description:
 */
@Data
@Schema(description = "停用检维修VO")
public class RiskUnitStopVO {

    private static final long serialVersionUID = 1L;

    @Schema(description = "id")
    private Long id;

    @Schema(description = "风险单元标识")
    private Long riskUnitId;

    @Schema(description = "风险对象")
    private Long riskObjectId;

    @Schema(description = "停用类型")
    private Integer stopType;

    @Schema(description = "停用开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date stopStartTime;

    @Schema(description = "停用结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date stopEndTime;

    @Schema(description = "原因")
    private String stopReason;

    @Schema(description = "备注")
    private String remarks;

    @Schema(description = "机构ID")
    private Long orgId;


    public String getRiskObjectIdStr() {
        return DictResolver.getItemLabelByValue(RiskModDictEnum.risk_object, this.getRiskObjectId());
    }

    public String getRiskUnitIdStr() {
        return DictResolver.getItemLabelByValue(RiskModDictEnum.risk_unit, this.getRiskUnitId());
    }

    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.getOrgId());
    }

    public String getStopTypeStr() {
        return DictResolver.getItemLabelByValue(RiskSysDictEnum.risk_stop_type, this.getStopType());
    }
}
